From: Dario Faggioli Date: Wed, 18 Mar 2015 13:20:37 +0000 (+0100) Subject: print online pCPUs and free pCPUs when dumping X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3572^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ec61696dc648bf71aaa7e0673862fb3a30b4a8ad;p=xen.git print online pCPUs and free pCPUs when dumping e.g., with `xl debug-key r', like this: (XEN) Online Cpus: 0-15 (XEN) Free Cpus: 8-15 Also, for each cpupool, print the set of pCPUs it contains, like this: (XEN) Cpupool 0: (XEN) Cpus: 0-7 (XEN) Scheduler: SMP Credit Scheduler (credit) Signed-off-by: Dario Faggioli Acked-by: Juergen Gross cpumask_weight() -> !cpumask_empty() Signed-off-by: Jan Beulich --- diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index cd6aab9661..a947c245f0 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #define for_each_cpupool(ptr) \ @@ -658,6 +659,12 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) return ret; } +static void print_cpumap(const char *str, const cpumask_t *map) +{ + cpulist_scnprintf(keyhandler_scratch, sizeof(keyhandler_scratch), map); + printk("%s: %s\n", str, keyhandler_scratch); +} + void dump_runq(unsigned char key) { unsigned long flags; @@ -671,12 +678,17 @@ void dump_runq(unsigned char key) sched_smt_power_savings? "enabled":"disabled"); printk("NOW=0x%08X%08X\n", (u32)(now>>32), (u32)now); + print_cpumap("Online Cpus", &cpu_online_map); + if ( !cpumask_empty(&cpupool_free_cpus) ) + print_cpumap("Free Cpus", &cpupool_free_cpus); + printk("Idle cpupool:\n"); schedule_dump(NULL); for_each_cpupool(c) { printk("Cpupool %d:\n", (*c)->cpupool_id); + print_cpumap("Cpus", (*c)->cpu_valid); schedule_dump(*c); }